package com.syh.jn.scm.service.api.supplier.stock.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

public interface StockGoodsRecordEnums {

  /**
   * 库存记录来源单据类型
   */
  @AllArgsConstructor
  @Getter
  public enum Type {

    //出入库类型(1：销售出库 2：销售退货入库 3：采购入库 4：采购退货出库 5：报损出库 6：报溢入库)
    SALE_ORDER(Short.valueOf("1"), "销售单类型", "来源单据类型"),
    SALE_RETURN_ORDER(Short.valueOf("2"), "销售退货单", "来源单据类型"),
    PURCHASE_ORDER(Short.valueOf("3"), "采购单", "来源单据类型"),
    PURCHASE_RETURN_ORDER(Short.valueOf("4"), "采购退货单", "来源单据类型"),
    STOCK_LOSS_BILL(Short.valueOf("5"), "报损单", "来源单据类型"),
    STOCK_SPILL_BILL(Short.valueOf("6"), "报溢单", "来源单据类型"),
    STOCK_OTHER_IN_BILL(Short.valueOf("7"), "其他入库单", "来源单据类型"),
    STOCK_OTHER_OUT_BILL(Short.valueOf("8"), "其他出库单", "来源单据类型");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static Type valueOf(Short status) {
      switch (status) {
        case 1:
          return SALE_ORDER;
        case 2:
          return SALE_RETURN_ORDER;
        case 3:
          return PURCHASE_ORDER;
        case 4:
          return PURCHASE_RETURN_ORDER;
        case 5:
          return STOCK_LOSS_BILL;
        case 6:
          return STOCK_SPILL_BILL;
        case 7:
          return STOCK_OTHER_IN_BILL;
        case 8:
          return STOCK_OTHER_OUT_BILL;
      }
      return null;
    }
  }
  @AllArgsConstructor
  @Getter
  public enum DataType {
    //操作类型(1：常规操作 2：回滚操作)
    NORMAL(Short.valueOf("1"), "常规操作", "操作类型"),
    ROLL_BACK(Short.valueOf("2"), "回滚操作", "操作类型");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static DataType valueOf(Short status) {
      switch (status) {
        case 1:
          return NORMAL;
        case 2:
          return ROLL_BACK;
      }
      return null;
    }
  }
  @AllArgsConstructor
  @Getter
  public enum InOutType {
    //出入类型(1：出库 2：入库)
    OUT(Short.valueOf("1"), "出库", "出入类型"),
    IN(Short.valueOf("2"), "入库", "出入类型");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static InOutType valueOf(Short status) {
      switch (status) {
        case 1:
          return OUT;
        case 2:
          return IN;
      }
      return null;
    }
  }

}
